<?php
/**
 * @version 0.1
 * @author Nick Swartele
 
 */

$recht_bitfield = new RechtBitfield();
$recht_bitfield->setBitfield($data_array_bitfield);

$recht_array = array('23,24');

if ($recht_bitfield->heeftRechten($recht_array) == false) {

 echo '<script type="text/javascript">      
           alert(\'Geen Rechten!\');
           window.location = "index.php";
           </script>';
            exit;
}else{


if (!isset($active)) {
    header('Location: ../index.php?page=home');
}

require_once FILE_CLASS_PERSOONSGEGEVENS;

$new = new Persoonsgegevens;

if (isset($_GET['deregno'])) {
    try {
        $new->setRegistratienummer($_GET['deregno']);
        $new->delete();
    } catch (Exception $e) {
        echo('An error has occured: ' . $e);
    }
} 

$selectpersonal = $new->select();
?>

<div id="header">
    <div id="logo"></div>
    <div id="headertext">Overzicht</div>
</div>
<div id="content2">
    <div id="contentbg">
        <div id="contentblock1">
            <div id="contentblock1text">
                <img src="images/person_summary.png" height="60px" widht="60" border="0" /> Personen Overzicht<br/>
                <table>
                    <tr>
                        <td style="width: 150px;">
                            Functie :
                        </td>
                        <td style="width:150px;"> 
                            Naam :
                        </td>
                        <td style="width:250px;">
                            personeelsnummer :
                        </td>  

                    </tr>

                </table>                 
<?php
foreach ($selectpersonal as $key => $personal) {

    echo "<div id='overzichttable'>";
    echo "<table>";
    echo "<tr> <td style ='width: 150px;'>" . $personal['functie'] . "</td> <td style ='width:180px';>" . $personal['naam'] . "</td> <td style ='width:120px';>" . $personal['registratienummer'] . "</td><td>
                  <ul>
                              <li> <a href='overzicht_perpersoon.php'></a></li>
                              <li> <a href='index.php?page=aanpassen_persoon&gebruikers_id=" . $personal['gebruikers_id'] . "'><img src='images/edit.png' height='20' width='20' border='0'></a></li>
                              <li> <a href='index.php?page=overzicht_persoon&deregno=" . $personal['registratienummer'] . "'><img src='images/delete.png' height='20' width='20' border='0'></a></li>  
                </ul>
                </td>";
    ?>
                    <?php
                    echo"</td> </tr>";
                    echo "</table>";
                    echo "</div>";
                }
                ?>
            </div>
            <br />
            <br />
            <a id="koppelknoppen" style="float:left;" href="index.php?page=overzicht">
                Terug
            </a>

        </div>
    </div>
</div>        
</div>
 
<?php
}